// 将图片地址转换为base64位
export function getBase64(file: File) {
    return new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => resolve(reader.result);
        reader.onerror = error => reject(error);
    });
}

// 数据获取为空，给提示
export const setNullData = (data: string | number, msg: string = '不详') => data ? data : msg;